#ifndef									__SOUNDROTATINGBUFFER_H__
#	define								__SOUNDROTATINGBUFFER_H__

#	include								<QMutex>
#	include								<vector>

class									SoundRotatingBuffer
{
public:
	SoundRotatingBuffer();
	~SoundRotatingBuffer();

private:
	std::vector<short*>					_data;
	std::vector<short*>::iterator		_read;
	std::vector<short*>::iterator		_write;
	size_t								_capacity;
	QMutex								_mutex;

public:
	virtual void						init(int, int);
	virtual short						*read();
	virtual short						*write();
	virtual bool						empty();
	virtual int							size();
	virtual int							capacity();
	virtual short						*operator[](size_t);
	void								reset();
};

#endif									// !__SOUNDROTATINGBUFFER_H__
